package com.atguigu.gmall.item.client;

import com.atguigu.gmall.common.result.Result;
import com.atguigu.gmall.item.client.impl.ItemDegradeFeignClient;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.Map;

/**
 * 详情微服务提供的Feign 客户端端接口
 * 作用：使用改接口代理对象远程调用详情微服务restful接口
 */
@FeignClient(value = "service-item" ,fallback = ItemDegradeFeignClient.class)
public interface ItemFeignClient {

    /**
     * 根据skuID汇总sku商品详情页所有数据
     *
     * @param skuId
     * @return
     */
    @GetMapping("/api/item/{skuId}")
    public Result<Map<String, Object>> getBySkuId(@PathVariable("skuId") Long skuId);
}
